/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-09-09
 * Time: 19:53
 */
import java.util.Date;
import static java.lang.Math.*;
public class TestDemo {
    public static void main(String[] args) {
        Student4 student1 = new Student4();
        System.out.println("======================");
        Student4 student2 = new Student4();
    }

    public static void main8(String[] args) {
        Student3 student = new Student3();
        student.show();
    }

    public static void main7(String[] args) {
        Student1 student1 = new Student1();
        //System.out.println(student1.classRoom);
        System.out.println(student1.getClassRoom());
        System.out.println(Student1.getClassRoom());
    }


    public static void main6(String[] args) {

        Student student1 = new Student("Bob","man",18,66.66);
        Student student2 = new Student("aob","man",181,66.666);
        Student student3 = new Student("cob","man",182,66.666);
        //student1.print("Bob","man",18,66.66,"bit");
        System.out.println(student1.classroom);
        System.out.println(student2.classroom);
        System.out.println(student3.classroom);
    }

    public static void main5(String[] args) {
        double x = 30;
        double y = 40;
        //double result = Math.sqrt(Math.pow(x,y) + Math.pow(x,y));
        double result = sqrt(pow(x, y) + pow(x, y));
        System.out.println(result);
    }

    public static void main4(String[] args) {
        Date date1 = new Date();
        System.out.println(date1.getTime());
    }

    public static void main3(String[] args) {
        //Date1 date1 = new Date1(2021,7,1);
        //Date1 date2 = new Date1();
        //Date1 date2 = new Date1();
        //date2.printDate();
        //Date1 date3 = new Date1();
        //Date1 date4 = new Date1(1999,1,1);
        //System.out.println(date4.day);
        java.util.Date date = new java.util.Date();
        System.out.println(date.getTime());

    }


    public static void main1(String[] args) {

//    Date1 date2 = new Date1(2022,8,2);
//    Date1 date3 = new Date1(2023,9,3);

//    date1.setDate(2021,7,1);
//    date2.setDate(2022,8,2);
//    date3.setDate(2023,9,3);


//    date2.printDate();
//    date3.printDate();


//        PetDog petdog1 = new PetDog();
//        PetDog petdog2 = new PetDog();
//
//        petdog1.name = "阿黄";
//        petdog1.color = "黄色";
//        petdog1.wag();
//        petdog1.braks();
//        petdog1.print();
//
//        petdog2.name = "阿黑";
//        petdog2.color = "黑色";
//        petdog2.wag();
//        petdog2.braks();
//        petdog2.print();

    }
}

class Student4 {
    private String name;
    private String gender;
    private int age;
    private static String classRoom;
    //实例代码块
    {
        this.name = "bit";
        this.gender = "man";
        this.age = 18;
        System.out.println("I am instance init()!");
    }
    //静态代码块
    {
        classRoom = "bit110";
        System.out.println("I am static init()!");
    }
    public Student4(){
        System.out.println("I am Student init()!");
    }
}

class Student3 {
    public String name;
    public String gender;
    public int age;

    public Student3() {
        System.out.println("i am student");
    }
    {
        this.name = "bit";
        this.gender = "man";
        this.age = 19;
    }
    public void show() {
        System.out.println("name:"+name+" age:"+age+" gender:"+gender);
    }
}



class Student1 {
    private static String classRoom = "bit110";

    public static String getClassRoom() {
        return classRoom;
    }
}





class Student {
    public String name;
    public String gender;
    public int age;
    public double score;
    public static String classroom = "Bit110";

    public Student(String name,String gender,int age,double score) {
        System.out.println("name"+name);
        System.out.println("gender"+ gender);
        System.out.println("age"+age);
    }

//    public void print(String name,String gender,int age,double score,String classroom) {
//        this.name = name;
//        this.gender = gender;
//        this.age = age;
//
//        System.out.println("name"+name);
//        System.out.println("gender"+ gender);
//        System.out.println("age"+age);
//        System.out.println(classroom);
//    }

}


class Date1 {
    public int year;
    public int month;
    private int day;

    public Date1(int year, int month, int day) {
        this();
        System.out.println("Date1(int,int,int)方法被调用了");
    }
    public Date1() {
        System.out.println("不带参数的构造方法");
    }

//        public Date1() {
//        this(1999,1,1);
//        System.out.println("不带参数的构造方法");
//    }

    //构造方法
//    public Date1(int year, int month, int day) {
//        this.year = year;
//        this.month = month;
//        this.day = day;
//        System.out.println("Date1(int,int,int)方法被调用了");
//    }
//    public Date1() {
//        System.out.println("不带参数的构造方法");
//    }

    public void printDate() {
        System.out.println(year+"/"+month+"/"+day);
    }
}

class Date2 {
    public int year;
    public int month;
    public int day;

    public void setDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public void printDate() {
        System.out.println(year+"/"+month+"/"+day);
    }
}

class PetDog {
    public String name;//姓名
    public String color;//颜色

    public void wag() {
        System.out.println("摇尾巴");
    }

    public void braks() {
        System.out.println("汪汪汪");
    }

    public void print() {
        System.out.println(this.name);
        System.out.println(this.color);
    }
}